package cn.ac.iscas.service.thesis;

import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ac.iscas.bean.base.DAOSupport;
import cn.ac.iscas.bean.patent.Patent;
import cn.ac.iscas.bean.patent.PatentPicture;
import cn.ac.iscas.bean.thesis.Thesis;
import cn.ac.iscas.bean.thesis.ThesisDocument;
import cn.ac.iscas.service.patent.IPatentPictureService;
@Service
@Transactional
public class ThesisServiceImp extends DAOSupport<Thesis> implements
		IThesisService {
	@Resource private IThesisDocService thesisDocService;
	@Override
	public void delete(Object entity) {
		Thesis thesis= (Thesis)entity;
		Set<ThesisDocument> docs = thesis.getWord();
		for(ThesisDocument file:docs)
		{
			System.out.println(file.getDocName());
			thesisDocService.delete(file);
		}
		super.delete(thesis);
	}
}
